package com.dzsw.order.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
@RequestMapping("/d1")
public class OrderDemo {

    @Value(value = "${post}")
    private String data1;

    @GetMapping("/t1")
    public String test(int sec) throws Exception {
        if (sec != 0) {
            Thread.sleep(sec * 1000);
        }
        return data1;
    }
}
